<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link href="../css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css"/>
	<link rel="stylesheet" href="../css/sendComment.css" media="all" />
</head>

<body class="gray">
	<div class="mui-content mui-scroll-wrapper" style="padding-bottom: 40px;">
		 <div class="mui-scroll refund loading" id="vueMain">
			   <ul class="mui-table-view refundover" style="margin-top: 0;">
			   		<li class="mui-table-view-cell order_num">NO.{{list.order_no}}</li>
			       <li class="mui-table-view-cell mui-media product">
			           <a href="javascript:;">
			               <img class="mui-media-object mui-pull-left" :src="list.img" />
			               <div class="mui-media-body ">
			                  	{{list.name}}
			                  	<p v-if="list.start_time==list.end_time"><span class="mui-pull-right">共{{list.goods_nums}}天</span>{{list.start_time}}</p>
			                  	<p v-else><span class="mui-pull-right">共{{list.goods_nums}}天</span>{{list.start_time}}至{{list.end_time}}</p>
			                  	<p><span class="mui-pull-right">数量:{{list.amount}}</span><span v-if="list.stro">已选:{{list.stro}}</span></p>
			                  	<p>下单日期:{{list.create_time}}</p>
			                  	<p>地址:{{list.province_name}}{{list.city_name}}{{list.area_name}}{{list.address}}</p>
			               </div>
			           </a>
			       </li>
			       <li class="mui-table-view-cell mui-media">
			       	 	<img class="mui-media-object mui-pull-right" style="border-radius: 50%;" :src="list.logo" />
			       	 	 <div class="mui-media-body shopname">
			       	 	 	{{list.shop_name}}
			       	 	 </div>
			       </li>
			   </ul>
			   
			   <ul class="mui-table-view isok" v-if="list.order_status==8">
		           <li class="mui-table-view-cell">
		           		<span>¥ {{list.refund_money}}</span>
		           		已退金额
		           </li>
		       </ul>
		       <ul class="mui-table-view isok" v-else>
		           <li class="mui-table-view-cell">
		           		<div class="mui-pull-right" v-if="list.order_status==7">审核中</div>
		           		<div class="mui-pull-right" v-if="list.order_status==10">拒绝退款</div>
		           		审核进度
		           </li>
		           <li class="mui-table-view-cell" v-if="list.dispose_idea">
		           		<div>详细信息</div>
		           		<div class="dispose_idea">{{list.dispose_idea}}</div>
		           </li>
		       </ul>
			    
			    
			    <div class="mui-content-padded" style="margin:25px 10px;" v-if="list.order_status==7">
			   		<div class="mui-col-xs-12 mui-col-sm-12"><button type="button" class="bexta-btn bexta-btn-yewllo mui-btn mui-btn-block cancleEnter">取消退款</button></div>
				</div>
			   <div class="mui-content-padded" style="margin:25px 10px;" v-if="list.order_status==10">
			   		<div class="mui-row btnsde">
			   			<div class="mui-col-xs-6 mui-col-sm-6"><button type="button" class="bexta-btn bexta-btn-yewllo mui-btn mui-btn-block cancleEnter">取消退款</button></div>
			   			<div class="mui-col-xs-6 mui-col-sm-6"><button type="button" class="bexta-btn bexta-btn-red mui-btn mui-btn-block enter link" _id="refund" _href="refund.html" _title="申请退款" :_extras="'order_no='+list.order_no" >重新申请</button></div>
			   		</div>
				</div>
	  </div>
	</div>

<script src="../js/mui.js"></script>
<script src="../js/mui.picker.min.js"></script>
<script src="../js/vue.min.js"></script>
<script src="../js/bexta.js"></script>
<script type="text/javascript">
	var apps, views, user;
	mui.plusReady(function () {
	    views = bexta.getWebview();
	    user = bexta.getStorage(USER);
	    bexta.ajax(api.refund_detail, function(res){
	    		initVue(res);
	    }, {data:{uid:user.uid, order_no:views.order_no}});
	});
	function initVue(res){
		apps = new Vue({
			el:'#vueMain',
			data:{
				list:res
			},
			mounted:function(){
				document.querySelector('.loading').classList.add('loadRun');
				mui('#vueMain').on('tap', '.cancleEnter', function(){
					mui.confirm("您确定要取消退款吗?",TITLE, CONFIRM, function(item){
						
						if( item.index == 1 ){
							bexta.ajax(api.del_refund, function(res, msg){
								mui.toast(msg);
								if( !res ){
									views.opener().evalJS("plus.webview.currentWebview().reload()");
									mui.later(function(){
										views.close('none');
									},500);
								}
							}, {data:{uid:user.uid, order_no:apps.list.order_no}})
						}
					});
				});
			}
		});
	}
	
	
window.addEventListener('reloadOrder', function(){
	plus.webview.currentWebview().reload();
});
</script>
</body>
</html>